package com.newsproject.service;

import com.newsproject.pojo.HotSearch;
import com.newsproject.pojo.Result;
import com.newsproject.pojo.vo.UserVo;

import org.springframework.ui.Model;
import org.springframework.http.ResponseEntity;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;


public interface UserService {
   //登录
    ModelAndView login(String email, String password, HttpSession session);
  //注册
    ModelAndView register(String email, String code,String password ,HttpSession session);
   //忘记密码
    ModelAndView updatePassword(String email ,String code,String newPassword,HttpSession session);
    Result updatePassword1(String email ,String code,String newPassword,HttpSession session);
  //注册会员
   // Result registerMember(User request);
   //根据email查询用户id
    Integer selectUserIdByEmail(String email);
   //判断邮箱是否存在
    boolean userExistByEmail(String email);
   //更新个人信息
    ResponseEntity<UserVo> updateUser(UserVo user, HttpSession session) throws Exception;
    //申请认证
    Result<Object> applyForVerification(HttpSession session,String applyInformation);
    //渲染个人主页
    String redirectToPersonalPage(HttpSession session,RedirectAttributes redirectAttributes,Model model);
    //渲染主页
    String redirectToMainPage(HttpSession session, Model model);
    //查询文章和微头条
    Result<Map<String,Object>> selectPostByPostTypeAndUserId(Integer userId, Integer postType, Integer pageNum,HttpSession session);

   Result<Map<String ,Object>> getBookMarkPostByUserId(int userId,Integer pageNum,HttpSession session);

    //更改密码
    Result<Object> setNewPassword(String email,String codeString ,String newPassword,HttpSession session);
    Result<List<HotSearch>> getTodayHotPost(Integer startPage);

    //查询用户的草稿箱
    Result<Map<String,Object>> selectDraftPostByPage(  Integer pageNum,HttpSession session);


}
